const Path = require('path');

module.exports = function ({ content, path, option, fileInfo }) {
    const less = require(Path.resolve(option.nmodulePath, './less'));
    let ops = {};
    if (option.develop) {
        ops = { sourceMap: { sourceMapFileInline: true } };
    }
    return less.render(content, Object.assign(ops, option.compiler.less || {})).then((output) => {
        return output.css;
    });
};